/* gcc -o t4 t4.c */

#include <stdio.h>

void main()
{
	int months[]={0,31,59,90,120,151,181,212,243,273,304,334};
	int year,month,day;
	int leap=0,sum=0;
	
	printf("Please input year:\n");
	scanf("%d\n",&year);

	printf("Please input month:\n");
	scanf("%d\n",&month);
	
	printf("Please input day:\n");
	scanf("%d\n",&day);
		
	if ( 0<month<=12)
		sum += 	months[month-1];
	else
		printf("Error: input day is impossibale!\n");
		
	sum += day;
	
	if ((year%400 == 0)||(year%4 == 0)&&(year%100 != 0))
	{
		leap = 1;
		printf("%d is a leap year.\n",year);
	}	
	
	sum += leap;
		
	printf("%d-%d-%d is %dth day of this year.\n",year,month,day,sum);
}